import React from 'react';
import { Menu } from 'antd';
import { 
  UserOutlined, 
  ShoppingCartOutlined, 
  BarChartOutlined 
} from '@ant-design/icons';
import { Link } from 'react-router-dom';

const { SubMenu } = Menu;

const SideMenu = () => {
  return (
    <Menu
      theme="dark"
      mode="inline"
      defaultSelectedKeys={['1']}
      defaultOpenKeys={['sub1']}
    >
      <SubMenu key="sub1" icon={<UserOutlined />} title="用户管理">
        <Menu.Item key="1">
          <Link to="/users">用户列表</Link>
        </Menu.Item>
      </SubMenu>
      <SubMenu key="sub2" icon={<ShoppingCartOutlined />} title="订单管理">
        <Menu.Item key="2">
          <Link to="/orders">订单列表</Link>
        </Menu.Item>
      </SubMenu>
      <SubMenu key="sub3" icon={<BarChartOutlined />} title="排名统计">
        <Menu.Item key="3">
          <Link to="/ranking">排名查看</Link>
        </Menu.Item>
      </SubMenu>
    </Menu>
  );
};

export default SideMenu;